#coding=utf-8

from django.template import RequestContext, loader, Context, Template
from django.shortcuts import render_to_response
from django.http import HttpResponse, Http404


def index(request, template_name='index.html'):
    return render_to_response(template_name, {})


def gears_manifest(request):
    '''
    tell google gears which part of this project will be cached!
    '''
    version = 'hash of entry versions'
    entries = [
        'images/logo.gif',
        'images/loading.gif',
        'images/blank.gif',
    ]
    return HttpResponse(Template('''
    {
        "betaManifestVersion" : 1,
        "version" : "{{ version }}",
        "entries" : [
                {% for entry in entries %}
                    { "url" : "{{ entry.url}}" }}
                {% endfor %}
                    ]
    }
    ''').reander(Context(locals())))
